﻿using System;
using System.Runtime.CompilerServices;

namespace boda.net.wpf.core.Helper
{
    /// <summary>
    /// 断言类型，判断参数或对象是否为空
    /// </summary>
    public static class Assert
    {
        public static void NotNull<T>(T obj, [CallerMemberName] string memberName = null)
        {
            if(ReferenceEquals(obj, null))
            {
                throw new ArgumentNullException($"断言错误:{nameof(memberName)}方法种的 {typeof(T)} 不可为空!");
            }
        }
    }
}
